Euclidean Rhythms
#リズム #音楽 #シンセ #Pattern
https://gyazo.com/377ce9906b77d07fea84bb8a54880247
ユークリッドの互除法をリズムに応用したGenerative Musicの手法
様々な民族音楽で用いられる特徴的なリズムが生成できるともっぱら言われるが、僕はあんまり知らないです
The Euclidean Algorithm Generates Traditional Musical Rhythmsという論文で提案された手法
See: https://www.lawtonhall.com/blog/euclidean-rhythms-pt1
要約
n-stepのなかでpulseを均等にk回鳴らすといい感じのリズムになるよ
16stepだけじゃなくてもっとへんてこな数字(5とか11とか)でもおもしろいよ
オフセットかけるのもおすすめだよ
16stepでの見た目
code:plain
1: x... .... .... ....
2: x... .... x... ....
3: x... .x.. ..x. ....
4: x... x... x... x...
5: x..x ..x. .x.. x...
6: x..x .x.. x..x .x..
7: x..x .x.x ..x. x.x.
8: x.x. x.x. x.x. x.x.
9: x.xx .x.x .xx. x.x.
10: x.xx .x.x x.xx .x.x
11: x.xx .xx. xx.x x.xx
12: x.xx x.xx x.xx x.xx
13: x.xx xx.x xxx. xxxx
14: x.xx xxxx x.xx xxxx
15: xxxx xxxx xxxx xxx.
16: xxxx xxxx xxxx xxxx
TidalCycles
TidalCyclesでは、Euclidean Rhythmsを簡単に生成できる記法「euclidean notation」がある
開発者yaxuによるチュートリアル
https://youtu.be/aD-35W7rnFM?si=186JG14eYfocS0RU?t=650
See: https://club.tidalcycles.org/t/blog-on-euclidean-rhythms/2016
See: https://yoppa.org/mit-sound20/11713.html
code:hs
d1 $ sound "bd(5, 16)"
Strudel
TidalCycles同様、euclidean notationが使える
https://strudel.cc/#c3RhY2soCiAgcygidHI4MDhfYmQqNCIpLAogIHMoInRyODA4X3BlcmMoNSwgMTYpIiksCikK
code:js
s("bd(5, 16)")
GLSL (Shader Music)
floorを使う
code:javascript
function euclideanRhythms(pulses, steps, i) {
var t = i % (steps / pulses)
return floor(t) == 0
}
ちょっと元論文とリズム違うけどだいたい一緒だよ
時間を取得
code:javascript
function euclideanRhythmsInteg(pulses, steps, time) {
var t = floor(time) % (steps / pulses)
return floor(t) + fract(time)
}
これでシェーダでも使えるね
実装
https://www.shadertoy.com/view/7ljczz